import request from "@/utils/request";

// 获取课程列表
export function getCourselList(page, type, formInline) {
  return request({
    url: "/admin/s/course",
    method: "get",
    params: {
      page,
      type,
      ...formInline
    }
  });
}

// 添加课程
export function addCourse(ruleForm, type) {
  return request({
    url: "/admin/s/course/save",
    method: "post",
    data: { ...ruleForm, type }
  });
}

// 删除课程
export function delCourse(ids) {
  return request({
    url: "/admin/s/course/delete",
    method: "post",
    data: { ids }
  });
}

// 上架 下架
export function updateStatus(id, status) {
  return request({
    url: "/admin/s/course/updatestatus",
    method: "post",
    data: { id, status }
  });
}

// 编辑课程
export function updateCourse(data) {
  return request({
    url: "/admin/s/course/update",
    method: "post",
    data
  });
}
